package org.lc.stk.model.paper;

import java.util.List;

import org.hibernate.annotations.Comment;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;

/**
 * 试卷
 */
@Entity
@Table(name = "examPaper")
@Comment("试卷")
public class ExamPaper {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    /**
     * 试卷组
     */
    @ManyToOne
    @Comment("试卷组")
    private ExamPaperSet set;

    @Column
    @Comment("试卷名称")
    private String name;

    /**
     * 试卷组内序号
     */
    @Comment("试卷组内序号")
    @Column(name = "[order]")
    private Integer order;

    @OneToMany
    @Comment("大题，一个试卷可以有多个大题，如选择题、填空题、问答题等")
    private List<ExamPaperQuestionSet> questionSets;

    @Column
    @Comment("总分")
    private Integer totalScore;

    public Integer getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(Integer totalScore) {
        this.totalScore = totalScore;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public ExamPaperSet getSet() {
        return set;
    }

    public void setSet(ExamPaperSet set) {
        this.set = set;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    public List<ExamPaperQuestionSet> getQuestionSets() {
        return questionSets;
    }

    public void setQuestionSets(List<ExamPaperQuestionSet> questionSets) {
        this.questionSets = questionSets;
    }
}
